<template>
  <div >
    <div class="style2-actions clearfix mgt10" v-if="isExistArray('3',gysInfo.system_function_model)">
      <div class="style2-actions-title">我的服务</div>
      <div @click="Jump('listsGys')"  v-if="gysInfo.supplier_flag && gysInfo.showSupplierOrder" class="action">
        <span class="icon-action icon2_4"></span>
        <span class="title">供货订单</span>
      </div>

      <div @click="Jump('supplierItems')"  v-if="gysInfo.supplier_flag && gysInfo.showSupplierItem" class="action">
        <span class="icon-action icon2_2"></span>
        <span class="title">供货商品</span>
      </div>

      <div @click="Jump('supplierWithdraw')"  v-if="gysInfo.supplier_flag && gysInfo.showSupplierWithdraw" class="action">
        <span class="icon-action icon2_14"></span>
        <span class="title">供货收入</span>
      </div>

      <div @click="Jump('tgyorder')"  v-if="gysInfo.is_tgy && gysInfo.showPromoterOrder" class="action">
        <span class="icon-action icon2_21"></span>
        <span class="title">招商经理订单</span>
      </div>

      <div @click="Jump('tgyRecommendGys')"  v-if="gysInfo.is_tgy && gysInfo.showRecommendedSupplier" class="action">
        <span class="icon-action icon1_7"></span>
        <span class="title">推荐供应商</span>
      </div>

      <div @click="Jump('/shareSelect')"  v-if="gysInfo.common_center_renovation_parameter.showShareLinkGys" class="action">
        <span class="icon-action icon20_1_fx"></span>
        <span class="title">万能链接</span>
      </div>
      <!-- 视频号数据 -->
      <div @click="Jump('venderOrder', {type: 'live'})" class="action" v-if="gysInfo.show_video_num_data_gys">
        <span class="icon-action icon_sphsj"></span>
        <span class="title">视频号数据</span>
      </div>
      <!-- 自定义项 -->
      <div v-if="gysInfo.dataset_gys && gysInfo.dataset_gys.length>0"
            v-for="(item,index) in gysInfo.dataset_gys"
            :key="index"
            class="action">
        <a @click="JumpUrl(item.link)">
          <span class="icon-action"
                :style="{backgroundImage: 'url('+item.pic+')',backgroundSize:'cover'}"></span>
          <span class="title">{{item.showtitle}}</span>
        </a>
      </div>
    </div>
  </div>
</template>

<script>
import Vue from 'vue'
import { openPage } from '@/utils/utils.js'
export default Vue.extend({
  props: {
    gysInfo: {
      type: Object
    }
  },
  methods: {
    // 判断数组是否存在某值
    isExistArray(val, array) {
      if (!array) return false
      const ret = array.indexOf(val)
      if (ret == -1) {
        return false
      } else {
        return true
      }
    },
    Jump(url, data) {
      this.$JumpPath(this, url, data)
    },
    JumpUrl(url) {
      openPage(url)
    },
    _show_qrcode() {
      this.$emit('showQrcode')
    }
  }
})
</script>

<style lang="scss">
@import 'src/styles/user/index.scss';
</style>
